#include "junix.h"

struct A
{
  int a;
  int b[0];
};

struct B
{
  char *s;
};

struct C
{
  char c;
  struct B b[0];		/* GNU C extention */
};

int main(int argc, char **argv)
{
  printf("%d\n",sizeof(struct A));
  struct A *pa=malloc(sizeof(struct A)+sizeof(int));
  int *pi=(int*)pa;
  *++pi=1234;
  printf("%d\n",*pa->b);

  struct B bb={"Hello,world\n"};

  struct C *pc=calloc(1,sizeof(struct C)+sizeof(struct B));
  pc->c='x';
  memmove(pc->b,&bb,sizeof(bb) );
  printf("%c\n%s",pc->c,pc->b->s);

  exit(0);
}

